package com.yiguo.realtime.utils

import java.io.InputStreamReader
import java.util.Properties

object PropertiesUtil {

  def load(propertieName:String): Properties ={
    /**
     * 加载类路径的properties文件，只需要调用load方法，自动将properties文件读取，封装一个properties返回
     */
    val prop=new Properties()
    prop.load(new InputStreamReader(Thread.currentThread().getContextClassLoader.getResourceAsStream(propertieName) , "UTF-8"))
    prop
  }

 //测试
  def main(args: Array[String]): Unit = {
    println(load("config.properties"))
  }
}
